﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using VisionCloud.Core.Model.Ms;
using VisionCloud.Domain.DtoModel.Applet.RequestDto;
using VisionCloud.Domain.DtoModel.Applet.ResponseDto;
using VisionCloud.Domain.DtoModel.Ms;

namespace VisionCloud.Domain.Repository.Interface.Ms
{
    public interface ICSMSTaskRepository : IBaseRepository<CSMSTask>
    {
        /// <summary>
        /// 获取任务总报告
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        GetSummaryReportRspDto GetSummaryReport(GetSummaryReportRqDto request);

        /// <summary>
        /// 获取某个时间段有上传任务数据的设备
        /// </summary>
        /// <param name="start_time">开始时间</param>
        /// <param name="end_time">结束时间</param>
        /// <returns></returns>
        Task<List<DeviceProjectPushDto>> GetLastUploadTaskDeviceAsync(DateTime start_time, DateTime end_time);

        /// <summary>
        /// 获取指定设备上传的数据
        /// </summary>
        /// <param name="deviceIds"></param>
        /// <returns></returns>
        Task<List<DeviceProjectPushDto>> GetLastUploadTaskDeviceAsync(List<Guid> deviceIds);

        /// <summary>
        /// 查询设备截止时间内的累计测量面积和累计作业天数
        /// </summary>
        /// <param name="deviceIds">设备ids</param>
        /// <param name="end_time">截止时间</param>
        /// <returns></returns>
        Task<List<DeviceStitisticsDto>> GetDeviceStitisticsAsync(List<Guid> deviceIds, DateTime end_time);

        /// <summary>
        /// 获取项目关联的设备
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        Task<List<Guid>> GetProjectRelevanceDeviceAsync(Guid projectId);

        /// <summary>
        /// 获取某段时间内设备上传的每日数据统计
        /// </summary>
        /// <param name="start_time"></param>
        /// <param name="end_time"></param>
        /// <returns></returns>
        Task<List<DeviceMeasureDayStatModel>> GetDeviceDayMeasureStatAsync(DateTime start_time, DateTime end_time);

        /// <summary>
        /// 根据项目Id和楼栋名获取已测量楼层信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<List<WxProjectFloorResponse>> WxGetReportData(WxProjectBuildingDto query);

        /// <summary>
        /// 获取任务的结果存储目录
        /// </summary>
        /// <param name="taskId"></param>
        /// <returns></returns>
        ValueTask<string> GetResultDataFilePathAsync(Guid taskId);

        /// <summary>
        /// 获取外立面下载的数据报告列表
        /// </summary>
        /// <param name="ids">任务id</param>
        /// <param name="dirPath">报告下载目录</param>
        /// <returns></returns>
        ValueTask<List<FileDownloadDto>> GetDownloadReportsAsync(List<Guid> ids, string dirPath);
    }
}